<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .da{
            display: flex;
        }
        .zuo{
            position: relative;
        }
        .zuo img{
            width: 400px;
            height: 400px;
        }
        .mc{
            pointer-events: none;
            width: 200px;
            height: 200px;
            background-color: rgba(0, 0, 0,0.45);
            position: absolute;
            left: 0;
            top: 0;
            display: none;
        }
        li{
            width: 60px;
            height: 60px;
            list-style: none;
            margin-left: 20px;
            margin-bottom: 25px;
        }
        li img{
            width: 60px;
            height: 60px;
        }
        .you{
            width: 400px;
            height: 400px;
            background-image: url(./images/1.jpg);
            margin-left: 20px;
            display: none;
        }
    </style>
</head>
<body>
    <div class="da">
        <div class="zuo">
            <img src="./images/1.jpg" alt="">
            <div class="mc">

            </div>
        </div>
        <ul>
            <li><img src="./images/1.jpg" alt=""></li>
            <li><img src="./images/2.jpg" alt=""></li>
            <li><img src="./images/3.jpg" alt=""></li>
            <li><img src="./images/4.jpg" alt=""></li>
            <li><img src="./images/5.jpg" alt=""></li>
        </ul>
        <div class="you" >
             
        </div>
    </div>
</body>
</html>
<script>
    var imgs=document.querySelectorAll("li img")
    var zt=document.querySelector('.zuo img')
    var mc=document.querySelector('.zuo .mc')
    var you=document.querySelector('.you')

    for(i=0;i<imgs.length;i++){
        imgs[i].onclick=function(){
            for(i=0;i<imgs.length;i++){
                imgs[i].style.border=''
            }
            zt.src=this.src
            this.style.border='2px solid red'
        }
        imgs[i].onmouseover=function(){
            this.style.border='2px solid yellow'
        }
        imgs[i].onmouseout=function(){
            this.style.border=''
        }
    }
    zt.onmouseenter=function(){
        mc.style.display='block'
        you.style.display='block'
    }
    zt.onmouseleave=function(){
        mc.style.display='none'
        you.style.display='none'
    }
    zt.onmousemove=function(e){
        var x=e.pageX -100
        var y=e.pageY -100
        x=x<0?0:x
        y=y<0?0:y
        x=x>200?200:x
        y=y>200?200:y
        mc.style.left=x+'px'
        mc.style.top=y+'px'
        you.style. backgroundImage= `url(${this.src})`
        you.style. backgroundPosition= `${-2*x}px ${-2*y}px`
    }
</script>